// https://umijs.org/config/
import { defineConfig } from 'umi';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';
export default defineConfig({
  chainWebpack(config){
    config.module
      .rule('woff')
      .test(/.(woff|eot|woff2|ttf|otf|TTF)$/)
      .use('file-loader')
      .loader('file-loader');
  },
  hash: true,
  antd: {},
  history: {
    type: 'hash',
  },
  targets: {
    ie: 9,
    chrome: 80,
  },
  dva: {},
  layout: {
    // https://umijs.org/zh-CN/plugins/plugin-layout
    locale: false,
    siderWidth: 208,
    ...defaultSettings,
  },
  theme: {
    '@primary-color': '#103289',
  },

  routes,
  access: {
    strictMode: true,
  },

  esbuild: {},
  //按需加载
  dynamicImport: {
    loading: '@/Loading',
  },
  dynamicImportSyntax: {},
  ignoreMomentLocale: true,
  proxy: proxy['dev'],

  // Fast Refresh 热更新
  fastRefresh: {},

  nodeModulesTransform: {
    type: 'none',
  },
  webpack5: {},
});
